import React, { Component } from 'react'
import { connect } from '../../react-redux'
import { increase, decrease } from '../../store/actions'

class ReduxDemo extends Component {
    render() {
        return (
            <div>
                <div>{this.props.calculateNum}</div>
                <button onClick={()=>{this.props.increase()}}>+</button>
                <button onClick={()=>{this.props.decrease()}}>-</button>
            </div>
        )
    }
}

export default connect(({ calculateNum }) => ({ calculateNum }), {
    increase,
    decrease
})(ReduxDemo)
// export default ReduxDemo;
